<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head-fragment(title,path)">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" th:href="@{/css/swiper-bundle.min.css}">
    <link rel="stylesheet" th:href="@{/css/iconfont.css}">
    <link rel="stylesheet" th:href="@{/css/common.css}">
    <link rel="stylesheet" th:href="@{/styles/header.css}">
    <link rel="stylesheet" th:href="@{'/styles/'+${path}+'.css'}">
</head>
<nav id="nav" th:fragment="nav-fragment">
    <div class="banner_x center">
        <a th:href="@{/index}" class="logo">
            <h1>BookStore</h1></a>
        <div class="fr">
            <form action="/search/str" id="strid">
            <div class="search">
                <input class="text" type="text" id="keyword" autocomplete="off" name="findstr">
                <input type="submit"class="button iconfont icon-search" >
            </div>

            </form>
        </div>
    </div>
</nav>
<header id="header" th:fragment="header-fragment">
    <div class="center">
        <ul class="fl">
            <li><a th:href="@{/index}">BookStore</a></li>
        </ul>
        <div class="fr">
            <th:block th:unless="${session.user_name==null}">
                <div class="user">
                    <ul class="selector">
                        <li>
                            <a th:href="@{/order}">
                                我的订单
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/logout}">
                                退出登录
                            </a>
                        </li>
                    </ul>
                    <a href="##" class="username">
                        <th:block th:text="${session.user_name}"></th:block>
                        <i class="iconfont icon-down"></i>
                    </a>
                </div>
                <div class="shopcart">
                    <a th:href="@{/cart}" style="color: white;"><i class="iconfont icon-cart"></i>
                        购物车</a>
                </div>
            </th:block>
            <th:block th:if="${session.user_name==null}">
                <ul class="login">
                    <li><a th:href="@{/toLogin}">登录</a></li>
                    <li><a th:href="@{/register}">注册</a></li>
                </ul>
                <div class="shopcart">
                    <a href="##" style="color: white;"><i class="iconfont icon-cart"></i>
                        购物车</a>
                </div>
            </th:block>
        </div>
    </div>
</header>
</html>
